package com.dadibadi.core.auth.controller;

import com.dadibadi.core.dao.mapper.UserAccountMapper;
import com.dadibadi.core.auth.qo.UserAccountIdQO;
import com.venusoft.developer.common.result.CommonResult;
import com.venusoft.developer.common.result.ICommonResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;


/**
 * TODO
 *
 * @author : lkfs@163.com
 * @date : 2025-06-10 14:11
 */

@RestController
@RequestMapping("/auth")
@Slf4j
@Tag(name = "api/auth认证", description = "")
public class ApiUserAccountDeleteController {
    @Resource
    private UserAccountMapper userAccountMapper;

    @PostMapping("/api-user-account-delete")
    @Operation(summary = "删除", description = "")
    public ICommonResult exec(
            @RequestBody @Parameter(required = true) @Validated UserAccountIdQO qo,
            @RequestHeader(required = false) String platform,
            @RequestHeader(required = false) String version,
            HttpServletRequest request) {

        userAccountMapper.deleteById(qo.getUserid());
        return new CommonResult<>("success");
    }
}
